package com.bnd.service;

import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

/**
 * 音色服务类
 */
public interface VoiceService {
    /**
     * 创建音色
     * @param url 音频文件地址，音频文件上传后会返回一个音频文件地址
     * @return 音色id
     * @throws NoApiKeyException
     * @throws InputRequiredException
     */
    String generateVoice(String url) throws NoApiKeyException, InputRequiredException;

    /**
     * 根据音色ID播放音频
     * @param voiceId 音色id
     * @return SseEmitter
     */
    SseEmitter playVoiceByVoiceId(String voiceId);

    /**
     * 根据文本播放音频
     * @param voiceId 音色id
     * @param text 文本
     * @return SseEmitter
     */
    SseEmitter playVoice(String voiceId, String text);
}